#include "ast.h"

AST_NODE *create_node (int type, TABLE_ENTRY * symbol, AST_NODE * son0, AST_NODE * son1, AST_NODE * son2, AST_NODE * son3)
{
	AST_NODE *node = (AST_NODE*)calloc(1, sizeof(AST_NODE));

	if(node != NULL)//se malloc não deu erro
	{
		node->type = type;
		node->symbol = symbol;
		node->son[0] = son0;
		node->son[1] = son1;
		node->son[2] = son2;
		node->son[3] = son3;
	}
	return node;	
}


void print_node( AST_NODE * node)
{}

void print_ast( AST_NODE * tree)
{
	if(tree->type == LIST)
	printf("%s", tree->symbol->name);
}
